package com.boot.document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * DESC: 客户关系数据实体类(映射索引)
 *
 * @author WangJie
 * @date Created in 2025-03-30 15:36
 * @path classPtah: /index/we_user_customer.json
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document (indexName = "we_user_customer", shards = 1, replicas = 0)
public class WeUserCustomer implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id(userId:customerId)
     */
    @Id
    @Field(name = "id", type = FieldType.Keyword)
    private String id;

    /**
     * userId(员工ID)
     */
    @Field(name = "userId", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String userId;

    /**
     * 员工姓名
     */
    @Field(name = "userName", type = FieldType.Text, analyzer = "ik_max_word")
    private String userName;

    /**
     * 员工编号 or 工号
     */
    @Field(name = "userNo", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String userNo;

    /**
     * 员工所属部门ID(全路径部门ID)
     */
    @Field(name = "department", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String[] department;

    /**
     * 员工所属部门名称
     */
    @Field(name = "departmentName", type = FieldType.Text, analyzer = "ik_max_word")
    private String departmentName;

    /**
     * customerId(客户ID)
     */
    @Field(name = "customerId", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String customerId;

    /**
     * 客户姓名
     */
    @Field(name = "customerName", type = FieldType.Text, analyzer = "ik_max_word")
    private String customerName;

    /**
     * 客户年龄
     */
    @Field(name = "age", type = FieldType.Integer)
    private Integer age;

    /**
     * 客户性别(1:男, 2:女)
     */
    @Field(name = "gender", type = FieldType.Integer)
    private Integer gender;

    /**
     * 客户电话号码
     */
    @Field(name = "mobile", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String mobile;

    /**
     * 客户邮箱
     */
    @Field(name = "email", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String email;

    /**
     * 客户所属行业
     */
    @Field(name = "industry", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String industry;

    /**
     * 客户所属公司名称
     */
    @Field(name = "companyName", type = FieldType.Text, analyzer = "ik_max_word")
    private String companyName;

    /**
     * 客户类型(1:普通客户, 2:企业客户)
     */
    @Field(name = "type", type = FieldType.Integer)
    private Integer type;

    /**
     * 客户信息备注
     */
    @Field(name = "remark", type = FieldType.Text, analyzer = "ik_max_word")
    private String remark;

    /**
     * 客户关系状态(1:正常, 2:失效)
     */
    @Field(name = "status", type = FieldType.Integer)
    private Integer status;

    /**
     * 客户关系创建时间
     */
    @Field(name = "createTime", type = FieldType.Date)
    private String createTime;

    /**
     * 客户标签列表
     */
    @Field(name = "tags", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String[] tags;

    /**
     * 客户触发关键词列表
     */
    @Field(name = "keywords", type = FieldType.Keyword, analyzer = "ik_max_word")
    private String[] keywords;

}
